
<script type="text/javascript">
<!--
	jQuery().ready(function(){
		jQuery.noConflict();
		jQuery(".lucky_num").click(function(){
			jQuery("#member_id").val(jQuery(this).html()) ;
			if(jQuery("#tbl_list_num").hasClass('display_none')){
				jQuery("#tbl_list_num").removeClass('display_none');
				jQuery("#tbl_list_num").addClass('display');
			}else{
				jQuery("#tbl_list_num").removeClass('display');
				jQuery("#tbl_list_num").addClass('display_none');
			}
		});
		jQuery("table tr.tr_lnum td").mouseover(function() {
			jQuery(this).parent().addClass("tr_hascolor") ;
			jQuery(this).addClass("td_hascolor") ;
		}).mouseout(function(){
			jQuery(this).parent().removeClass("tr_hascolor") ;
			jQuery(this).removeClass("td_hascolor") ;
		});
	});
//-->
</script>
<!-- start show lucky number -->
<table id='tbl_list_num' style='border: 1px solid #d0d0d0 ;' cellspacing='0' cellpadding='2' class='display'>
	<tr class='tr_lnum tr_first'>
	<?php 
	$i = 0 ;
	$tr_type = 'tr_le' ;
	$td_type = '' ;
	$r = 1 ;
	foreach($this->lists_lucky_number as $lnum):
		if(($i!=0) && ($i%5 ==0)):
			$r++ ;
			if($r%2==0 && $r != 1):
				$tr_type = 'tr_chan' ;				
			else:
				$tr_type = 'tr_le' ;
			endif ;
			echo '</tr>';
			echo "<tr class='tr_lnum ".$tr_type."'>" ;
		endif;
		if($tr_type == 'tr_chan'):
			if($i%2==0 && $i != 0):
				$td_type = 'td_chan' ;
			else:
				if($i%5 == 0):
					$td_type = ' td_first' ;
				else:
					if(($i+1)%5 == 0):
						$td_type = ' td_last' ;
					else:
						$td_type = ' td_le' ;
					endif;
				endif;
			endif ;					
		else:
			if($i==0):
				$td_type = 'td_first ' ;
			else:
				if($i%2==0):
					if(($i+1)%5 == 0):
						$td_type = 'td_last' ;
					else:
						$td_type = ' td_le' ;
					endif;
				else:
					$td_type = 'td_chan' ;
				endif ;	
			endif;
		endif ;
		echo "<td class='lucky_num ".$td_type."'>".$lnum->text."</td>";
		$i++;
	endforeach;
	?>
	</tr>
	<tr>
		<td colspan='5'>
			<span style='float:left ;'>
			<?php if($this->total_lucky_number > 0 && $this->limitstart >= 20):?>
				<a class="lnum_prev" onclick="loadLuckynum(<?php echo intval($this->limitstart -20); ?>)">
				<img title="Prev" style="float: right ;" src="<?php echo JURI::base() .'/components/com_wrd/assets/images/prev.png'?>">
				</a>
			<?php endif; ?>
			</span>
			<span style='float:right ;'>
			<?php if($this->total_lucky_number > 20 && $this->limitstart >= 0 && intval($this->limitstart + 20) < $this->total_lucky_number):?>
				<a class="lnum_next" onclick="loadLuckynum(<?php echo abs(intval($this->limitstart + 20)) ; ?>)">
				<img title="Next" style="float: right ;" src="<?php echo JURI::base() .'/components/com_wrd/assets/images/next_items.png'?>">
				</a>
			<?php endif; ?>
			</span>
		</td>
	</tr>
</table>
<!-- end show lucky number -->